<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
	<title>DHTML Tree samples. dhtmlXTree - Save data</title>
</head>
<style>
	body {font-size:12px}
	.{font-family:arial;font-size:12px}
	h1 {cursor:hand;font-size:16px;margin-left:10px;line-height:10px}
	xmp {color:green;font-size:12px;margin:0px;font-family:courier;background-color:#e6e6fa;padding:2px}
</style>
<body>
	<h1>Save data</h1>
	<link rel="STYLESHEET" type="text/css" href="../css/dhtmlXTree.css">
	<script  src="../js/dhtmlXCommon.js"></script>
	<script  src="../js/dhtmlXTree.js"></script>
	<script  src="../js/dhtmlXTree_ed.js"></script>
	<script  src="../dhtmlXDataProcessor/js/dhtmlXDataProcessor.js"></script>
	<table>
		<tr>
			<td>
				<div id="treeboxbox_tree" style="width:250; height:218;background-color:#f5f5f5;border :1px solid Silver;; overflow:auto;"></div>
			</td>
			<td rowspan="2" style="padding-left:25" valign="top">
			</td>
		</tr>
		<tr>
			<td>
                <a href="#" onclick="tree.insertNewChild(tree.getSelectedItemId()||0,(new Date()).valueOf(),'New item')">Add node as child of selected</a> <br/>
                <a href="#" onclick="tree.insertNewNext(tree.getSelectedItemId(),(new Date()).valueOf(),'New item')">Add node next to selected</a> <br/>
                <a href="#" onclick="tree.deleteItem(tree.getSelectedItemId());">Delete selected row</a><br/>
                Double click any item to edit it.
			</td>
		</tr>
	</table>
<hr>
<xmp>
	<script  src="../js/dhtmlXTree_ed.js"></script>
	<script  src="../dhtmlXDataProcessor/js/dhtmlXDataProcessor.js"></script>
    <div id="treeboxbox_tree" style="width:250; height:218;background-color:#f5f5f5;border :1px solid Silver;; overflow:auto;"></div>
	<script>
           	tree=new dhtmlXTreeObject("treeboxbox_tree","100%","100%",0);
           	tree.setImagePath("../imgs/");
           	tree.enableDragAndDrop(true);
           	tree.enableItemEditor(true);
           	tree.loadXML("../dhtmlXDataProcessor/server_code/PHP/get.php?ctrl=tree");

        	myDataProcessor = new dataProcessor("../dhtmlXDataProcessor/server_code/PHP/update.php?ctrl=tree");
        	myDataProcessor.init(tree);
	</script>

</xmp>

	<script>

			tree=new dhtmlXTreeObject("treeboxbox_tree","100%","100%",0);
			tree.setImagePath("../imgs/");
			//tree.enableSmartXMLParsing(true);
            tree.enableDragAndDrop(true);
            tree.enableItemEditor(true);
			tree.loadXML("../dhtmlXDataProcessor/server_code/PHP/get.php?ctrl=tree");

        	//init dataprocessor and assign verification function
        	myDataProcessor = new dataProcessor("../dhtmlXDataProcessor/server_code/PHP/update.php?ctrl=tree");
        	//add after-update event handler
			myDataProcessor.setOnAfterUpdate(function(nodeId,cType,newId){
				alert(nodeId+","+cType+","+newId)
			});

			myDataProcessor.init(tree);
	</script>
<br><br>

</body>
</html>
